package com.poseidon.proxy.vo;

import com.pandora.common.exception.EduException;
import com.pandora.common.util.StringUtils;

public class DemoImpl implements Demo {

	public void add(String param) throws EduException {
		if (StringUtils.isEmpty(param)) {
			throw new EduException("新增内容不能为空");
		}
		System.out.println("新增操作成功->param：" + StringUtils.nullToStrTrim(param));
	}

	public void delete(int id) throws EduException {
		if (id == 0) {
			throw new EduException("要删除的主键ID不能为空");
		}
		System.out.println("删除操作成功->id:" + id);
	}

	public void update(int id, String param1, String param2) throws EduException {
		if (id == 0) {
			throw new EduException("要更新的主键ID不能为空");
		}
		if (StringUtils.isEmpty(param1)) {
			throw new EduException("更新内容param1不能为空");
		}
		if (StringUtils.isEmpty(param2)) {
			throw new EduException("更新内容param2不能为空");
		}
		System.out.println(("更新操作成功->id:" + id + "; param1:" + StringUtils.nullToStrTrim(param1) + "; param2:"
				+ StringUtils.nullToStrTrim(param2)));
	}

	public String select(int id) throws EduException {
		if (id == 0) {
			throw new EduException("要查询的主键ID不能为空");
		}
		System.out.println("查询操作成功->id:" + id);
		return "返回结果集";
	}
}